feat(ledger): persist ledger on unprotected ledger-state branch (your chosen path)#22
Merged
Conversation
…h (no main bypass) github-actions[bot] cannot be granted main-ruleset bypass (GitHub 422), so instead of committing the ledger to protected main, each run restores it from — and persists it to — a dedicated UNPROTECTED `ledger-state` branch via the Contents API. This delivers cross-run coverage accounting with the default GITHUB_TOKEN, no bypass and no loosening of main protection; main stays purely reviewed case data. - New "Restore ledger from ledger-state" step before extraction; "Persist ledger to ledger-state" step after Validate+PII guard (creates the branch on first run). - Same three-way fence: schema+no-URL validation, pii_guard over data/_meta, and the Contents API writing exactly one path. - The data-review PR always excludes data/_meta (the ledger is never in it). - Drops the LEDGER_TO_MAIN gating (unneeded — this just works). CONTRIBUTING §Operations + LAUNCH_REVIEW K updated. Python code unchanged (the pipeline still reads/writes the working-tree ledger; the workflow moves it to/from the branch). Ledger unit + schema tests still green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your choice: the ledger-state branch path.
github-actions[bot]can't be granted main-bypass (GitHub 422), so the ledger persists on a dedicated unprotectedledger-statebranch — restored before each run, persisted after, via the Contents API. Cross-run coverage accounting works with the defaultGITHUB_TOKEN, no bypass, main untouched. Same three-way fence (schema+no-URL, pii_guard, one-path Contents API). Data PR excludesdata/_meta.LEDGER_TO_MAINgating dropped. Python code unchanged.